﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml;

public partial class left : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    /// <summary>
    /// 获取菜单项
    /// </summary>
    /// <returns></returns>
  public  string getMenu()
    {
        if (Session["sRole"] != null)
        {
            string role = string.Empty;
            switch (Session["sRole"].ToString())
            {
                case "学员": role="student"; break;
                case "老师": role = "teacher"; break;
                case "机构": role = "organization"; break;
                case "管理员":role="admin"; break;
            }
            XmlDocument xml = new XmlDocument();
            
            xml.Load(Server.MapPath("~/nav.xml"));
            return xml.SelectSingleNode(string.Format("//role[@name='{0}']/lv1", role)).InnerText;
        }
        else
        {
            return string.Empty;
        }
    }
}
